using System;
using System.Collections;
using System.Collections.Generic;

namespace Windy.OpenLink
{
    public class EmptyEnumerable<T> : IEnumerable<T>, IEnumerator<T>, IEnumerator, IDisposable
    {
        #region Singleton

        protected static Lazy<EmptyEnumerable<T>> instance = new Lazy<EmptyEnumerable<T>>();

        public static IEnumerable<T> Enumerable { get { return instance.Value; } }

        public static IEnumerator<T> Enumerator { get { return instance.Value; } }

        #endregion Singleton

        #region IEnumerable<T> Members

        public IEnumerator<T> GetEnumerator()
        {
            return this;
        }

        #endregion IEnumerable<T> Members

        #region IEnumerable Members

        System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator()
        {
            return this;
        }

        #endregion IEnumerable Members

        #region Enumerator Members

        T IEnumerator<T>.Current
        {
            get { return default(T); }
        }

        object System.Collections.IEnumerator.Current { get { return default(T); } }

        bool System.Collections.IEnumerator.MoveNext() { return false; }

        void System.Collections.IEnumerator.Reset() { }

        void System.IDisposable.Dispose() { }

        #endregion Enumerator Members
    }
}